using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class DisturbSetting : GeneratedMessageLite<DisturbSetting, DisturbSetting.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<DisturbSetting, DisturbSetting.Builder>
		{
			private bool resultIsReadOnly;
			private DisturbSetting result;
			protected override DisturbSetting.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override DisturbSetting MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override DisturbSetting DefaultInstanceForType
			{
				get
				{
					return DisturbSetting.DefaultInstance;
				}
			}
			public uint NightSetting
			{
				get
				{
					return this.result.NightSetting;
				}
				set
				{
					this.SetNightSetting(value);
				}
			}
			public DisturbTimeSpan NightTime
			{
				get
				{
					return this.result.NightTime;
				}
				set
				{
					this.SetNightTime(value);
				}
			}
			public uint AllDaySetting
			{
				get
				{
					return this.result.AllDaySetting;
				}
				set
				{
					this.SetAllDaySetting(value);
				}
			}
			public DisturbTimeSpan AllDayTime
			{
				get
				{
					return this.result.AllDayTime;
				}
				set
				{
					this.SetAllDayTime(value);
				}
			}
			public Builder()
			{
				this.result = DisturbSetting.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(DisturbSetting cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private DisturbSetting PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					DisturbSetting other = this.result;
					this.result = new DisturbSetting();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override DisturbSetting.Builder Clear()
			{
				this.result = DisturbSetting.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override DisturbSetting.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new DisturbSetting.Builder(this.result);
				}
				return new DisturbSetting.Builder().MergeFrom(this.result);
			}
			public override DisturbSetting BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override DisturbSetting.Builder MergeFrom(IMessageLite other)
			{
				if (other is DisturbSetting)
				{
					return this.MergeFrom((DisturbSetting)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override DisturbSetting.Builder MergeFrom(DisturbSetting other)
			{
				return this;
			}
			public override DisturbSetting.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override DisturbSetting.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(DisturbSetting._disturbSettingFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = DisturbSetting._disturbSettingFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 8u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 8u)
						{
							this.result.hasNightSetting = input.ReadUInt32(ref this.result.nightSetting_);
							continue;
						}
					}
					else
					{
						if (num3 == 18u)
						{
							DisturbTimeSpan.Builder builder = DisturbTimeSpan.CreateBuilder();
							if (this.result.hasNightTime)
							{
								builder.MergeFrom(this.NightTime);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.NightTime = builder.BuildPartial();
							continue;
						}
						if (num3 == 24u)
						{
							this.result.hasAllDaySetting = input.ReadUInt32(ref this.result.allDaySetting_);
							continue;
						}
						if (num3 == 34u)
						{
							DisturbTimeSpan.Builder builder2 = DisturbTimeSpan.CreateBuilder();
							if (this.result.hasAllDayTime)
							{
								builder2.MergeFrom(this.AllDayTime);
							}
							input.ReadMessage(builder2, extensionRegistry);
							this.AllDayTime = builder2.BuildPartial();
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public DisturbSetting.Builder SetNightSetting(uint value)
			{
				this.PrepareBuilder();
				this.result.hasNightSetting = true;
				this.result.nightSetting_ = value;
				return this;
			}
			public DisturbSetting.Builder ClearNightSetting()
			{
				this.PrepareBuilder();
				this.result.hasNightSetting = false;
				this.result.nightSetting_ = 0u;
				return this;
			}
			public DisturbSetting.Builder SetNightTime(DisturbTimeSpan value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasNightTime = true;
				this.result.nightTime_ = value;
				return this;
			}
			public DisturbSetting.Builder SetNightTime(DisturbTimeSpan.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasNightTime = true;
				this.result.nightTime_ = builderForValue.Build();
				return this;
			}
			public DisturbSetting.Builder MergeNightTime(DisturbTimeSpan value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasNightTime && this.result.nightTime_ != DisturbTimeSpan.DefaultInstance)
				{
					this.result.nightTime_ = DisturbTimeSpan.CreateBuilder(this.result.nightTime_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.nightTime_ = value;
				}
				this.result.hasNightTime = true;
				return this;
			}
			public DisturbSetting.Builder ClearNightTime()
			{
				this.PrepareBuilder();
				this.result.hasNightTime = false;
				this.result.nightTime_ = null;
				return this;
			}
			public DisturbSetting.Builder SetAllDaySetting(uint value)
			{
				this.PrepareBuilder();
				this.result.hasAllDaySetting = true;
				this.result.allDaySetting_ = value;
				return this;
			}
			public DisturbSetting.Builder ClearAllDaySetting()
			{
				this.PrepareBuilder();
				this.result.hasAllDaySetting = false;
				this.result.allDaySetting_ = 0u;
				return this;
			}
			public DisturbSetting.Builder SetAllDayTime(DisturbTimeSpan value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasAllDayTime = true;
				this.result.allDayTime_ = value;
				return this;
			}
			public DisturbSetting.Builder SetAllDayTime(DisturbTimeSpan.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasAllDayTime = true;
				this.result.allDayTime_ = builderForValue.Build();
				return this;
			}
			public DisturbSetting.Builder MergeAllDayTime(DisturbTimeSpan value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasAllDayTime && this.result.allDayTime_ != DisturbTimeSpan.DefaultInstance)
				{
					this.result.allDayTime_ = DisturbTimeSpan.CreateBuilder(this.result.allDayTime_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.allDayTime_ = value;
				}
				this.result.hasAllDayTime = true;
				return this;
			}
			public DisturbSetting.Builder ClearAllDayTime()
			{
				this.PrepareBuilder();
				this.result.hasAllDayTime = false;
				this.result.allDayTime_ = null;
				return this;
			}
		}
		public const int NightSettingFieldNumber = 1;
		public const int NightTimeFieldNumber = 2;
		public const int AllDaySettingFieldNumber = 3;
		public const int AllDayTimeFieldNumber = 4;
		private static readonly DisturbSetting defaultInstance;
		private static readonly string[] _disturbSettingFieldNames;
		private static readonly uint[] _disturbSettingFieldTags;
		private bool hasNightSetting;
		private uint nightSetting_;
		private bool hasNightTime;
		private DisturbTimeSpan nightTime_;
		private bool hasAllDaySetting;
		private uint allDaySetting_;
		private bool hasAllDayTime;
		private DisturbTimeSpan allDayTime_;
		private int memoizedSerializedSize = -1;
		public static DisturbSetting DefaultInstance
		{
			get
			{
				return DisturbSetting.defaultInstance;
			}
		}
		public override DisturbSetting DefaultInstanceForType
		{
			get
			{
				return DisturbSetting.DefaultInstance;
			}
		}
		protected override DisturbSetting ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint NightSetting
		{
			get
			{
				return this.nightSetting_;
			}
		}
		public DisturbTimeSpan NightTime
		{
			get
			{
				return this.nightTime_ ?? DisturbTimeSpan.DefaultInstance;
			}
		}
		public uint AllDaySetting
		{
			get
			{
				return this.allDaySetting_;
			}
		}
		public DisturbTimeSpan AllDayTime
		{
			get
			{
				return this.allDayTime_ ?? DisturbTimeSpan.DefaultInstance;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasNightSetting && this.hasNightTime && this.hasAllDaySetting && this.hasAllDayTime && this.NightTime.IsInitialized && this.AllDayTime.IsInitialized;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasNightSetting)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.NightSetting);
				}
				if (this.hasNightTime)
				{
					num += CodedOutputStream.ComputeMessageSize(2, this.NightTime);
				}
				if (this.hasAllDaySetting)
				{
					num += CodedOutputStream.ComputeUInt32Size(3, this.AllDaySetting);
				}
				if (this.hasAllDayTime)
				{
					num += CodedOutputStream.ComputeMessageSize(4, this.AllDayTime);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private DisturbSetting()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] disturbSettingFieldNames = DisturbSetting._disturbSettingFieldNames;
			if (this.hasNightSetting)
			{
				output.WriteUInt32(1, disturbSettingFieldNames[2], this.NightSetting);
			}
			if (this.hasNightTime)
			{
				output.WriteMessage(2, disturbSettingFieldNames[3], this.NightTime);
			}
			if (this.hasAllDaySetting)
			{
				output.WriteUInt32(3, disturbSettingFieldNames[0], this.AllDaySetting);
			}
			if (this.hasAllDayTime)
			{
				output.WriteMessage(4, disturbSettingFieldNames[1], this.AllDayTime);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasNightSetting)
			{
				num ^= this.nightSetting_.GetHashCode();
			}
			if (this.hasNightTime)
			{
				num ^= this.nightTime_.GetHashCode();
			}
			if (this.hasAllDaySetting)
			{
				num ^= this.allDaySetting_.GetHashCode();
			}
			if (this.hasAllDayTime)
			{
				num ^= this.allDayTime_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			DisturbSetting disturbSetting = object_0 as DisturbSetting;
			return disturbSetting != null && (this.hasNightSetting == disturbSetting.hasNightSetting && (!this.hasNightSetting || this.nightSetting_.Equals(disturbSetting.nightSetting_))) && (this.hasNightTime == disturbSetting.hasNightTime && (!this.hasNightTime || this.nightTime_.Equals(disturbSetting.nightTime_))) && (this.hasAllDaySetting == disturbSetting.hasAllDaySetting && (!this.hasAllDaySetting || this.allDaySetting_.Equals(disturbSetting.allDaySetting_))) && (this.hasAllDayTime == disturbSetting.hasAllDayTime && (!this.hasAllDayTime || this.allDayTime_.Equals(disturbSetting.allDayTime_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<DisturbSetting, DisturbSetting.Builder>.PrintField("NightSetting", this.hasNightSetting, this.nightSetting_, writer);
			GeneratedMessageLite<DisturbSetting, DisturbSetting.Builder>.PrintField("NightTime", this.hasNightTime, this.nightTime_, writer);
			GeneratedMessageLite<DisturbSetting, DisturbSetting.Builder>.PrintField("AllDaySetting", this.hasAllDaySetting, this.allDaySetting_, writer);
			GeneratedMessageLite<DisturbSetting, DisturbSetting.Builder>.PrintField("AllDayTime", this.hasAllDayTime, this.allDayTime_, writer);
		}
		public static DisturbSetting ParseFrom(byte[] data)
		{
			return DisturbSetting.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private DisturbSetting MakeReadOnly()
		{
			return this;
		}
		public static DisturbSetting.Builder CreateBuilder()
		{
			return new DisturbSetting.Builder();
		}
		public override DisturbSetting.Builder ToBuilder()
		{
			return DisturbSetting.CreateBuilder(this);
		}
		public override DisturbSetting.Builder CreateBuilderForType()
		{
			return new DisturbSetting.Builder();
		}
		public static DisturbSetting.Builder CreateBuilder(DisturbSetting prototype)
		{
			return new DisturbSetting.Builder(prototype);
		}
		static DisturbSetting()
		{
			DisturbSetting.defaultInstance = new DisturbSetting().MakeReadOnly();
			DisturbSetting._disturbSettingFieldNames = new string[]
			{
				"AllDaySetting",
				"AllDayTime",
				"NightSetting",
				"NightTime"
			};
			DisturbSetting._disturbSettingFieldTags = new uint[]
			{
				24u,
				34u,
				8u,
				18u
			};
			object.ReferenceEquals(micromsg.Proto.DisturbSetting.Descriptor, null);
		}
	}
}
